package com.thread4;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Test {
	public static void main(String[] args) {
		initRunnable();
		initCallable();
		initThrea();

	}

	public static void initRunnable() {
		RunnDemo runnableD = new RunnDemo();
		Thread thread = new Thread(runnableD);
		thread.start();

	}

	public static void initThrea() {
		ThreadDe th = new ThreadDe();
		th.start();
	}

	public static void initCallable() {
		ExecutorService executor = Executors.newFixedThreadPool(3);
		CallableDe callableDe = new CallableDe();
		Future<String> future = executor.submit(callableDe);
		try {
			System.out.println("get==" + future.get());
		} catch (InterruptedException | ExecutionException e) {
			e.printStackTrace();
		}

	}
}
